package com.xjie.mall.goods.controller;


import com.xjie.mall.common.Result;
import com.xjie.mall.goods.model.Product;
import com.xjie.mall.goods.service.SpuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 商品SPU表 前端控制器
 * </p>
 *
 * @author xjie
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/spu")
public class SpuController {

    @Autowired
    private SpuService spuService;

    /**
     * 新增商品
     * @param product
     * @return
     */
    @PostMapping(value = "/save")
    public Result saveProduct(@RequestBody Product product)
    {
        spuService.saveProduct(product);
        return Result.success();
    }

}
